Skip to content

Enhance Python Timestamp to be precision-variable up to nanos, and map it to Timestamp logical type - #39537

Merged
ahmedabu98 merged 6 commits into
apache:masterfrom
ahmedabu98:python_timestamp_logicaltype
Jul 30, 2026
Merged

Enhance Python Timestamp to be precision-variable up to nanos, and map it to Timestamp logical type#39537
ahmedabu98 merged 6 commits into
apache:masterfrom
ahmedabu98:python_timestamp_logicaltype

Conversation

@ahmedabu98

@ahmedabu98 ahmedabu98 commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Continuing the work to establish a parameterized Timestamp logical type see design doc (Python Nanosecond Support).

Makes the Java Timestamp logical type (beam:logical_type:timestamp:v1) portable and maps it to Python's Timestamp, which now supports variable subsecond precision (0–9 digits).

Precision defaults to micros to maintain backwards compatibility, and Timestamp typehints still map to micros_instant to maintain update compatibility.

Operations that would silently drop sub-microsecond detail (e.g. micros, to_utc_datetime) will throw unless allow_lossy_conversion=True. New standard_coders.yaml cases pin the wire format cross-SDK.

Addresses the Timestamp part of #19922


Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Mention the appropriate issue in your description (for example: addresses #123), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, comment fixes #<ISSUE NUMBER> instead.
  • Update CHANGES.md with noteworthy changes.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.

To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md

GitHub Actions Tests Status (on master branch)

Build python source distribution and wheels
Python tests
Java tests
Go tests

See CI.md for more information about GitHub Actions CI or the workflows README to see a list of phrases to trigger workflows.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

Comment thread CHANGES.md Outdated
@tvalentyn

Copy link
Copy Markdown
Contributor

overall LGTM, thanks!
please take a look at docs errors and feel free to merge once tests pass.
I read through the PR and couldn't think of any issues, but lmk if there is a particular section you'd like me or other reviewers to double check.

@ahmedabu98
ahmedabu98 merged commit f5feab8 into apache:master Jul 30, 2026
128 of 131 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants